{% extends "admin/base.html" %}

{% block title %}仪表盘{% endblock %}

{% block extra_js %}
{% endblock %}

{% block page_title %}仪表盘{% endblock %}

{% block content %}
<div class="card">
    <div class="card-header">
        <h2>欢迎使用后台管理系统</h2>
    </div>
    <div class="card-body">
        <p>这是您的个人网站管理后台，您可以通过左侧菜单管理网站的各项设置。</p>
        
        <div style="margin-top: 30px;">
            <h3 style="margin-bottom: 20px; color: #2c3e50;">快速统计</h3>
            <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;">
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #3498db;">{% if contacts_count %}{{ contacts_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">联系方式</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #2ecc71;">{% if links_count %}{{ links_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">网站链接</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #e74c3c;">{% if tags_count %}{{ tags_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">标签数量</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #9b59b6;">{% if titles_count %}{{ titles_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">标题数量</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #e67e22;">{% if search_engines_count %}{{ search_engines_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">搜索引擎</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #1abc9c;">{% if static_pages_count %}{{ static_pages_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">静态网页</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #e74c3c;">{% if today_visit_count %}{{ today_visit_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">今日访问</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #3498db;">{% if yesterday_visit_count %}{{ yesterday_visit_count }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">昨日访问</div>
                </div>
                <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center;">
                    <div style="font-size: 36px; font-weight: bold; color: #2ecc71;">{% if total_visits %}{{ total_visits }}{% else %}0{% endif %}</div>
                    <div style="color: #666; margin-top: 10px;">总访问量</div>
                </div>
            </div>
        </div>
        

        <div style="margin-top: 40px;">
            <h3 style="margin-bottom: 20px; color: #2c3e50;">快速操作</h3>
            <div style="display: flex; flex-wrap: wrap; gap: 10px;">
                <a href="/admin/website-config" class="btn btn-primary">
                    配置网站信息
                </a>
                <a href="/admin/contacts/add" class="btn btn-success">
                    添加联系方式
                </a>
                <a href="/admin/links/add" class="btn btn-secondary">
                    添加网站链接
                </a>
                <a href="/admin/tags/add" class="btn btn-primary">
                    添加标签
                </a>
                <a href="/admin/titles/add" class="btn btn-success">
                    添加标题
                </a>
                <a href="/admin/search-engines/add" class="btn btn-secondary">
                    添加搜索引擎
                </a>
                <a href="/admin/static-pages/add" class="btn btn-primary">
                    添加静态页面
                </a>
            </div>
        </div>
    </div>
</div>
{% endblock %}